﻿using System;
using System.Drawing;

namespace Eksponent.CropUp
{
    public class Cropping
    {
        public PointF TopLeft { get; set; }
        public PointF BottomRight { get; set; }

        public int TargetWidth { get; set; }
        public int TargetHeight { get; set; }

        /// <summary>
        /// Gets a value indicating whether the aspect ratio of the cropping and target differs significantly.
        /// </summary>
        /// <value>
        ///   <c>true</c> if so; otherwise, <c>false</c>.
        /// </value>
        public bool Pad
        {            
            get { return Math.Abs((BottomRight.X - TopLeft.X)/(BottomRight.Y - TopLeft.Y) - (double) TargetWidth/TargetHeight) > 0.01; }
        }
    }
}